package dl.bukkit.myststus.function.trigger.imp;

import dl.bukkit.myststus.configuration.imp.Config;
import dl.bukkit.myststus.function.trigger.TriggerHud;
import dl.bukkit.myststus.library.ats.GComponent;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerJoinEvent;

@GComponent(
        key = "join",
        author = "DogLong"
)
public class JoinTrigger extends TriggerHud<PlayerJoinEvent> {
    @Override
    public boolean isRemove(PlayerJoinEvent event) {
        return false;
    }

    @Override
    public Class<PlayerJoinEvent> getEvent() {
        return PlayerJoinEvent.class;
    }


    @Override
    public Player getPlayer(PlayerJoinEvent event) {
        return event.getPlayer();
    }

    @Override
    public Entity getTarget(PlayerJoinEvent event) {
        return event.getPlayer();
    }

    @Override
    public boolean isRegister() {
        return Config.getInst().getBoolean("Trigger.Join");
    }
}
